﻿using System;
using System.Windows.Forms;

namespace mLabControls
{
    public class mLabLabel : Label
    {
        private string prijevod;

        public string Prijevod
        {
            get { return prijevod; }
            set { prijevod = value; }
        }
        public mLabLabel()
            : base()
        {
            this.Paint += new System.Windows.Forms.PaintEventHandler(this.Prevedi);
            this.AutoSize = false;
            this.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.Size = new System.Drawing.Size(200, 20);
        }

        protected void Prevedi(object sender, PaintEventArgs e)
        {
            string text;
            try
            {
                text = TranslateLabela.Prevedi(this.prijevod);
                this.Text = text;
            }
            catch
            {
            }
        }   
    }
}
